/**
 * @(#)com.basic.collection.ListTest
 *
 * Copyright (c) 2014-2018 上海纬视瑞科技有限公司
 *
 * DESC:
 *
 */
package com.basic.collection;

import java.util.*;

/**
 * @author fusf
 * @version 1.0  2017/3/14
 */
public class ListTest {

    //测试Vector 是线程安全的，ArrayList是线程不安全的
    public static void main(String[] args) {
        //List list = new Vector(500);
        //List list = Collections.synchronizedList(new ArrayList());
        //List list = new ArrayList();
        List list = new LinkedList();
        TestThread testThread = new TestThread(list);
        for (int i = 0; i < 100; i++) {
            new Thread(testThread).start();
        }
        System.out.println("size:" + list.size());
    }


}
